package com.dubbo.lian.common.util;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mzlion.easyokhttp.HttpClient;

import java.util.Map;

/**
 * Created by Administrator on 2016/11/22 0022.
 */
public  class HttpUtil {

    public static String postAsString(Map map, String url){
        String responseData = HttpClient
                .post(url)
                .param(map)
                .execute()
                .asString();
        return responseData;
    }

    public static JSONObject postAsJson(Map map, String url){
        String responseData = HttpClient
                .post(url)
                .param(map)
                .execute()
                .asString();
        return JSON.parseObject(responseData);
    }

}
